﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LX.Core.Auth
{
    /// <summary>
    /// 授权上下文
    /// </summary>
    public interface IAuthTicketManager<T> where T : IPrincipal
    {
        bool IsLogined();

        /// <summary>
        /// 获取当前安全主体
        /// </summary>
        /// <returns></returns>
        T GetCurrentPrincipal();

        /// <summary>
        /// 设置当前安全主体
        /// </summary>
        /// <param name="principal"></param>
        /// <param name="option"> </param>
        void SetCurrentPrincipal(T principal, TicketPersistentOption option);


    }
}
